﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Data.Objects.DataClasses;
using ADONETDataServicesExtension;
using ADONETDataServicesExtension.BLLUtils;

namespace BLL
{
    [EFEntityType(TypeName = "EFEntities.Information")]
    public class Information
    {
        public Information()
        {
        }
        public Information(EFEntities.Information informations)
        {
            EFInformation = informations;
        }

        private EFEntities.Information _efInformation;
        internal EFEntities.Information EFInformation 
        {
            get
            {
                if (_efInformation == null)
                    _efInformation = new EFEntities.Information();
                return _efInformation;
            }
            private set { _efInformation = value; }
        }

        [EFEntityProperty]
        public string Address1
        {
            get { return EFInformation.Address1; }
            set { EFInformation.Address1 = value; }
        }

        [EFEntityProperty]
        public string Address2
        {
            get { return EFInformation.Address1; }
            set { EFInformation.Address1 = value; }
        }

        [EFEntityProperty]
        public string PostalCode
        {
            get { return EFInformation.PostalCode; }
            set { EFInformation.PostalCode = value; }
        }

        [EFEntityProperty]
        public string City
        {
            get { return EFInformation.City; }
            set { EFInformation.City = value; }
        }

        [EFEntityProperty]
        public string Region
        {
            get { return EFInformation.Region; }
            set { EFInformation.Region = value; }
        }

        [EFEntityProperty]
        public string Country
        {
            get { return EFInformation.Country; }
            set { EFInformation.Country = value == null ? null : value.ToUpper(); }
        }
    }
}
